package com.work.controller;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.mybatis.Page;
import com.work.model.WorkOrderDo;
import com.work.service.WorkOrderService;

@Controller
@RequestMapping("/work")
public class WorkOrderController {
	private Logger log = Logger.getLogger(WorkOrderController.class);
	@Autowired
	private WorkOrderService workOrderService;
	
	
	@RequestMapping("/workList")
	public void  workList(ModelMap map,WorkOrderDo workOrder,Page page){
//		Page<WorkOrderDo> page = new Page<WorkOrderDo>(); 
		List<WorkOrderDo> list = workOrderService.queryWorkOrder(workOrder,page);
		map.put("workOrderList", list);
		
		map.put("allPage", page.getTotalPage());
		map.put("allSize", page.getTotalRecord());
		
		map.put("page", page);
	}
	 
	
}
